﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.HomeServer.Controls;

namespace Umbrella.Whs.WhsAddin.SettingsControls
{
    public partial class SharePointNotUmbrella : SettingsControlBase
    {
        public SharePointNotUmbrella(UmbrellaSettingsTab tab)
            : base(tab)
        {
            if (_log.IsDebugEnabled)
                _log.Debug("Initialization start");

            try
            {
                InitializeComponent();

                // done
                if (_log.IsDebugEnabled)
                    _log.Debug("Initialization done");
            }
            catch (Exception e)
            {
                _log.Fatal("Failed to initialize", e);

                throw;
            }
        }

        private void uninstallSharePointLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                _tab.Services.OpenUrl("http://codenameumbrella.codeplex.com/wikipage?title=UninstallSharePointManual");
            }
            catch (Exception x)
            {
                _log.Error("Failed to open FAQ website link", x);

                QMessageBox.Show(
                    x.Message,
                    Properties.Resources.txtErrorFailedOpeningFaqLink,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    );
            }
        }
    }
}
